home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / lb09c.zip / OPEN.BAS < prev    next >
BASIC Source File  |  1992-01-30  |  700b  |  33 lines

  1.  
  2.  
  3.     'test the file capabilities
  4.     PRINT "Now will open a file and print some information into it."
  5.  
  6.     OPEN "TESTFILE" FOR OUTPUT AS #TEST
  7.     PRINT #TEST, "This is a test of the emergency broadcast"
  8.     PRINT #TEST, "system.   This is only a test."
  9.     PRINT #TEST, ""
  10.  
  11.     PRINT "Please type a sentence."
  12.     INPUT ">"; s$
  13.     length = LEN(s$)
  14.  
  15.     ' break s$ up, one line per word
  16.     sLen = LEN(s$)
  17.     FOR count = 1 TO sLen
  18.         c$ = MID$(s$,count,1)
  19.         copy$ = copy$ + c$
  20.         IF c$ <> " " THEN [Skip]
  21.         copy$ = copy$ + CHR$(13) + CHR$(10)
  22.  
  23. [Skip]
  24.  
  25.     NEXT count
  26.  
  27.     PRINT #TEST, copy$
  28.     PRINT copy$
  29.  
  30.     CLOSE #TEST
  31.  
  32.     PRINT "Done."
  33.